package org.lds.hotkey.console.business.hotkey.converter;

import org.lds.hotkey.console.business.hotkey.entity.HotKey;
import org.lds.hotkey.console.business.hotkey.model.request.HotKeyBaseGetByKeyRequest;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

@Component
public class HotKeyBaseGetByKeyRequestToEntityConverter implements Converter<HotKeyBaseGetByKeyRequest, HotKey> {

    @Override
    public HotKey convert(HotKeyBaseGetByKeyRequest source) {
        return HotKey.builder()
                .appId(source.getAppId())
                .key(source.getKey())
            .build();
    }

}